package com.example.kalaok;

import java.io.IOException;
import java.util.Map;

import com.example.kalaok.PlayView.PlayStatus;
import com.example.kalaok.util.SystemUiHider;

import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;

public class PlayActivity extends Activity{
	private PlayView mPlayView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play);
        MyApplication.gPlayActivity = this;
        mPlayView = (PlayView)findViewById(R.id.surface);
	}
	
	@Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
    
    @Override
    protected void onResume() {
        super.onResume();
        mPlayView.showToolBar(true);
    }
    
    public boolean onKeyUp(int keyCode,KeyEvent event){ 
    	switch(keyCode){  
		case KeyEvent.KEYCODE_MENU: 
			mPlayView.showToolBar(!mPlayView.mToolbarVisible);
			break;
		default:
			mPlayView.showToolBar(true);
    	}
		return super.onKeyUp(keyCode, event);
    }  
    
    public void cutSong()
	{
		mPlayView.cutSong();
	}
}
